package com.JohnCarloSalter.BackEnd;

import java.util.ArrayList;

public class Menu {
	private ArrayList<Item> menu; //Item number is the index value.
	//Menu should not be altered, so we will hardcode it here as a default constructor.
	public Menu() {
		menu = new ArrayList<Item>();
		menu.add(new Item("Wings n' things platter", 15, "Wings, potatoes, celery, and shame."));
		menu.add(new Item("Steak steak steak! (and eggs)", 8, "Comes with a side of steak."));
		menu.add(new Item("Crepes a la toomuchsugar", 7, "These certainly aren't creppy!"));
	}
	
	public Item getItem(int itemNumber) {
		return menu.get(itemNumber);
	}
	
	//Converts the method to a string and returns it.
	public String toString() {
		String returnString = "====MENU====\n";
		returnString += String.format("%s%40s\n", "Item", "Price");
		for(int i=0; i<menu.size(); i++) {
			returnString += String.format("%s%f\n", getItem(i).getName(), getItem(i).getPrice());
		}
		return returnString;
	}
}
